#ifndef __METHOD_INFO_H__
#define __METHOD_INFO_H__
#include "attribute_info.h"
#include "util.h"
#include "types.h"
#include <vector>
using namespace std;

class method_info {
public:
	short access_flags;
	short name_index;
	short descriptor_index;
	short attributes_count;
	vector<attribute_info*> attributes;
public:
	method_info(char* &buffer,vector<cp_info*> constant_pool){
		access_flags = getU2(buffer);buffer += 2;
		name_index = getU2(buffer);buffer += 2;
		descriptor_index = getU2(buffer);buffer += 2;
		attributes_count = getU2(buffer);buffer += 2;
	/*	cout<<"method_info::attributes_count::"<<attributes_count<<'\n';*/
		for(int i = 0; i < attributes_count; i++){
			attribute_info *ai = attribute_info::create(buffer,constant_pool);
			attributes.push_back(ai);
		}
	}
};
#endif